import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: MENG
 * Date: 2022-08-05
 * Time: 22:36
 */
public class Main {
    //坏键盘打字
    //str2实际输入的，str1期望输入的
    public static void func(String str1,String str2){
        Set<Character> set = new HashSet<>();
        for (char ch : str2.toUpperCase().toCharArray()) {
            set.add(ch);
        }

        Set<Character> set2 = new HashSet<>();
        for (char ch : str1.toUpperCase().toCharArray()) {
            if(!set.contains(ch) && !set2.contains(ch)){
                System.out.print(ch);
                set2.add(ch);
            }
        }
    }
    //坏键盘打字的main
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        while(scan.hasNextLine()){
            String str1 = scan.nextLine();
            String str2 = scan.nextLine();
            func(str1,str2);
        }
    }

    public static void main2(String[] args) {
        String str = "baaccd";
        System.out.println(OjTest.firstUniqChar(str));

    }

    //OJ第一题，找出只出现一次的数字
    public static void main1(String[] args) {
        int[] nums = {2,2,3,3,4,4,5};
        OjTest ojTest = new OjTest();
        System.out.println(ojTest.singleNum(nums));
    }
}